package com.aia.ann.web.xml;

import org.apache.log4j.Logger;

import com.aia.ann.service.ChiefService;
import com.opensymphony.xwork2.ActionSupport;

public class AnnVisitCountXml extends ActionSupport  {
	private static final Logger logger = Logger.getLogger(AnnVisitCountXml.class);
	private static final long serialVersionUID = 1L;
	private ChiefService chiefService;
	private long visitCount;


	public void setChiefService(ChiefService chiefService) {
		this.chiefService = chiefService;
	}

	public ChiefService getChiefService() {
		return chiefService;
	}

	public String execute() throws Exception {
		if (logger.isDebugEnabled()) {
			logger.debug("AnnUploadXml - start"); //$NON-NLS-1$
		}
		
		try {
			chiefService.updateVisitCount(this);
		} catch (Exception e) {
			visitCount = 999l;
			logger.error("Unknown Error:" + e, e);
		}
		
		return SUCCESS;
	}

	public void setVisitCount(long visitCount) {
		this.visitCount = visitCount;
	}

	public long getVisitCount() {
		return visitCount;
	}

}
